﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SportManager
{
    /// <summary>
    /// Program options.
    /// </summary>
    [Serializable]
    public class Options
    {
        /// <summary>
        /// Google login for calendar.
        /// </summary>
        public string GoogleAccaunt { get; set; }
        /// <summary>
        /// Path to user calendar.
        /// </summary>
        public string GoogleCalendarPath { get; set; }
        /// <summary>
        /// Password for google calendar. 
        /// </summary>
        public string GooglePassword { get; set; }
    }

    /// <summary>
    /// Class for keeping Options data in registry.
    /// </summary>
    public class OptionsRegistryKeeper : IDataManager<Options>
    {
        public Options GetData()
        {
            return KeepersBridge<RegistryKeeper<Options>, Options>.GetData(new string[] { OptionsRegistryPath });
        }

        public void SaveData()
        {
            KeepersBridge<RegistryKeeper<Options>, Options>.SaveData(new string[] { OptionsRegistryPath });
        }

        private readonly string OptionsRegistryPath = "Software\\" + Settings.Default.EnglishProgramName + "\\Settings";
    }
}
